/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Administrateur
 */
@Entity
@Table(name = "description")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Description.findAll", query = "SELECT d FROM Description d"),
    @NamedQuery(name = "Description.findByIddescription", query = "SELECT d FROM Description d WHERE d.iddescription = :iddescription"),
    @NamedQuery(name = "Description.findByDescriptionBref", query = "SELECT d FROM Description d WHERE d.descriptionBref = :descriptionBref"),
    @NamedQuery(name = "Description.findByIdUnDescrip", query = "SELECT d FROM Description d WHERE d.idUnDescrip = :idUnDescrip")})
public class Description implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @NotNull
    @Column(name = "iddescription")
    private int iddescription;
    @Basic(optional = false)
    @NotNull
    @Lob
    @Size(min = 1, max = 16777215)
    @Column(name = "description")
    private String description;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "description_bref")
    private String descriptionBref;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_un_descrip")
    private Integer idUnDescrip;
    @JoinColumn(name = "idLangue", referencedColumnName = "idlangue")
    @ManyToOne(optional = false)
    private Langue idLangue;

    public Description() {
    }

    public Description(Integer idUnDescrip) {
        this.idUnDescrip = idUnDescrip;
    }

    public Description(Integer idUnDescrip, int iddescription, String description, String descriptionBref) {
        this.idUnDescrip = idUnDescrip;
        this.iddescription = iddescription;
        this.description = description;
        this.descriptionBref = descriptionBref;
    }

    public int getIddescription() {
        return iddescription;
    }

    public void setIddescription(int iddescription) {
        this.iddescription = iddescription;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getDescriptionBref() {
        return descriptionBref;
    }

    public void setDescriptionBref(String descriptionBref) {
        this.descriptionBref = descriptionBref;
    }

    public Integer getIdUnDescrip() {
        return idUnDescrip;
    }

    public void setIdUnDescrip(Integer idUnDescrip) {
        this.idUnDescrip = idUnDescrip;
    }

    public Langue getIdLangue() {
        return idLangue;
    }

    public void setIdLangue(Langue idLangue) {
        this.idLangue = idLangue;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idUnDescrip != null ? idUnDescrip.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Description)) {
            return false;
        }
        Description other = (Description) object;
        if ((this.idUnDescrip == null && other.idUnDescrip != null) || (this.idUnDescrip != null && !this.idUnDescrip.equals(other.idUnDescrip))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Description[ idUnDescrip=" + idUnDescrip + " ]";
    }
    
}
